<template>
</template>

<script lang="ts">
import { defineComponent, onMounted } from 'vue'

export default defineComponent({
  name: 'ProductDetail',
  performanceMark: 'ProductDetail', // 启用组件性能监控，必须的唯一标识
  
  setup() {
    onMounted(() => {
      // 手动测量特定操作
      const start = performance.now()
      // 执行复杂操作
      const duration = performance.now() - start
      
      // 上报自定义指标
      const { $performance } = useCurrentInstance()!.appContext.config.globalProperties
      $performance.track('product-calculation', { duration })
    })
  }
})
</script>

<style>
</style>